package palf.commands {
import flash.display.DisplayObjectContainer;

import palf.Gallery;
import palf.menu.Menu;
import palf.menuItems.MenuItem;
import palf.visualEffects.layout.Layout;
import palf.visualEffects.transitions.Transition;

public class CommandFactory {

	public function CommandFactory() {

	}

	public function createMacroCommand(commands : Vector.<Command>) : Command {
		var macro : MacroCommand = new MacroCommand();
		var command : Command;
		for each(command in commands) {
			macro.addCommand(command);
		}
		return macro;
	}

	public function applyLayout(target : DisplayObjectContainer, layout : Layout) : Command {
		return new ApplyLayout(target, layout);
	}

	public function applyEffectToGallery(gallery : Gallery, transition : Transition) : Command {
		return new ApplyEffectToGallery(gallery, transition);
	}

	public function navigateMenu(menu : Menu, content : Vector.<MenuItem>) : Command {
		return new MenuNavigationCommand(menu, content);
	}

	public function run(func : Function, args : Array = null) : Command {
		return new RunCommand(func, args);
	}
}

}
